package com.hcy.schedulingapi.controller;

import com.hcy.rabbitbasicmodel.model.ReturnResult;
import com.hcy.schedulingclient.model.customer.request.CallCancelRequestDTO;
import com.hcy.schedulingclient.model.customer.request.CallCarRequestDTO;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author huchenying
 * @Description
 * @Date 2022/3/4 23:53
 */
@RestController
@RequestMapping("/call")
public class CallCarController {
    private static final Logger logger = LoggerFactory.getLogger(CallCarController.class);

    @Value("${CUSTOMER_CALL}")
    public String CUSTOMER_CALL;

    /**
     * @Author huchenying
     * @Description 乘客叫车的redis续命时间，每隔一段时间续命 key ttl
     * @Date
     **/
    @PostMapping("/reCall")
    public ReturnResult reCall(CallCarRequestDTO requestDTO){
        logger.info("reCall start param -> {}", ToStringBuilder.reflectionToString(requestDTO));
        return ReturnResult.success();
    }

    /**
     * @Author huchenying
     * @Description 取消叫车 ， 删除 redis key
     * @Date
     **/
    @PostMapping("/cancelCall")
    public ReturnResult cancelCall(CallCancelRequestDTO requestDTO){
        logger.info("cancelCall start param -> {}",ToStringBuilder.reflectionToString(requestDTO));
        return ReturnResult.success();
    }


}
